<?php echo $this->load->view('meta'); ?>
<link rel="stylesheet" href="<?=base_url()?>css/admin.css" type="text/css" media="screen" />
<title>xa-ncsu | admin - mail</title>
<?php echo $this->load->view('header'); ?>
<?=form_open('admin/sendMail');?>
<fieldset>
	<legend><span>Send a Message</span></legend>
	<ol class="fivehundred">
		<li><label for="from">from:</label>
			<?=$from->email?></li>
		<li><label for="to">to:</label>
			<?php if ($to_type == "group"): ?>
				<?=$to->description?>
			<?php elseif ($to_type =="user"): ?>
				<?=$to->email?>
			<?php endif; ?>
		</li>
	
		<li><label for="subject">subject:</label>
			<input type="input" name="subject" /></li>
		<li><label for="message">message:</label>
			<textarea name="message" rows="20"></textarea>
		</li>
		<li>
			<?=form_hidden('to_type', $to_type);?>
			<?php if ($to_type == "group"): ?>
				<?=form_hidden('to', $to->groupid);?>
			<?php elseif ($to_type =="user"): ?>
				<?=form_hidden('to', $to->userid);?>
			<?php endif; ?>			
			<?=form_submit('','send') ?> <?=anchor('groups', 'Cancel');?></li>
	</ol>
</fieldset>
<?=form_close()?>
<?php echo $this->load->view('footer'); ?>